<include file="SpStore:header" />
		<!----《/头部结束》----->
		<div class="ncsc-layout wrapper">
			<include file="SpStore:order_left" />
			<div id="layoutRight" class="ncsc-layout-right sticky">
				<div class="ncsc-path"><i class="icon-desktop"></i>商家管理中心<i class="icon-angle-right"></i>订单物流<i class="icon-angle-right"></i>实物交易订单</div>
				<div class="main-content" id="mainContent">
				  
					<div class="tabmenu">
					  <ul class="tab pngFix">
						  <li class="normal"><a href="/store/order_list.html">所有订单</a></li>
						  <li class="normal"><a href="/store/order_unpay.html">待付款</a></li>
						  <li class="normal"><a href="/store/order_unsend.html">待发货</a></li>
						  <li class="active"><a href="/store/order_untake.html">已发货</a></li>
						  <li class="normal"><a href="/store/order_finish.html">已完成</a></li>
					  </ul>
					</div>
					<form method="get" action="index.php" target="_self">
					  <table class="search-form">
						<input type="hidden" name="act" value="store_order">
						<input type="hidden" name="op" value="index">
							<input type="hidden" name="state_type" value="store_order">
							
							<tbody>
								<tr>
									<td>&nbsp;</td>
									<td><input type="checkbox" id="skip_off" value="1" name="skip_off"> <label for="skip_off">不显示已关闭的订单</label></td>
									<th>下单时间</th>
									<td class="w240"><input type="text" class="text w70 hasDatepicker" name="query_start_date" id="query_start_date" value="" readonly="readonly"><label class="add-on"><i class="icon-calendar"></i></label>&nbsp;–&nbsp;<input id="query_end_date" class="text w70 hasDatepicker" type="text" name="query_end_date" value="" readonly="readonly"><label class="add-on"><i class="icon-calendar"></i></label></td>
									<th>买家</th>
									<td class="w100"><input type="text" class="text w80" name="buyer_name" value=""></td>
									<th>订单编号</th>
									<td class="w160"><input type="text" class="text w150" name="order_sn" value=""></td>
									<td class="w70 tc"><label class="submit-border">
										<input type="submit" class="submit" value="搜索">
									</label>
									</td>
								</tr>
						  </tbody>
					  </table>
					</form>
					<table class="ncsc-default-table order">
					  <thead>
						<tr>
						  <th class="w10"></th>
						  <th colspan="2">商品</th>
						  <th class="w100">单价（元）</th>
						  <th class="w40">数量</th>
						  <th class="w110">买家</th>
						  <th class="w120">订单金额</th>
						  <th class="w100">交易状态</th>
						  <th class="w150">交易操作</th>
						</tr>
					  </thead>
					  
					   <foreach name="list" item="vo">
						<tbody>
						<tr>
							<td colspan="20" class="sep-row"></td>
						</tr>
						<tr>
							  <th colspan="20">
								<span class="ml10">订单编号：<em>{$vo.order_sn}</em>
								</span> 
								<span>下单时间：<em class="goods-time">{$vo.add_time|=date('Y-m-d H:i:s',###)}</em></span> 
								<span class="fr mr5"> 
									<a href="" class="ncsc-btn-mini" target="_blank" title="打印发货单"><i class="icon-print"></i>打印发货单</a>
								</span>
							 </th>
						</tr>
						<foreach name="vo.goods_list" item="gvo">
						<tr>
						   <td class="bdl"></td>
							  <td class="w70">
								<div class="ncsc-goods-thumb">
									<a href="" target="_blank">
										<img src="{$gvo.goods_image}" onmouseover="toolTip('<img src={$gvo.goods_image}>')" onmouseout="toolTip()">
									</a>
								</div>
							   </td>
							   <td class="tl">
									<dl class="goods-name">
									  <dt>
										<a target="_blank" href="">{$gvo.goods_name}  <font style="color:red;">{$gvo.color_n} {$gvo.spec_n}</font></a>
									  </dt>
<!-- 									  <dd>
										<span class="sale-type">团购</span>
									  </dd> -->
									</dl>
							   </td>
							  <td>
							  
								<if condition="$gvo.goods_pay_price gt 0">
								￥{$gvo.goods_pay_price}
									<if condition="$gvo.point_num gt 0">
										+
									</if>
								</if>
								<if condition="$gvo.point_num gt 0">
								{$gvo.point_num}&nbsp;积分
								</if>
								<if condition="$gvo.coin_num gt 0">
								{$gvo.coin_num}&nbsp;增值币
								</if>
							  
							  </td>
							  <td>{$gvo.goods_num} </td>
							  <notequal name="gorder_type" value="$vo.order_id">
							
							  <!-- S 合并TD -->
							  <td class="bdl" rowspan="{$vo.i}" {$gorder_type=$vo.order_id} >
								<div class="buyer">
									{$vo.buyer_name}          
								  <p member_id="3"></p>
								  <div class="buyer-info"> <em></em>
									<div class="con">
									  <h3><i></i><span>联系信息</span></h3>
									  <dl>
										<dt>姓名：</dt>
										<dd>{$vo.realname}</dd>
									  </dl>
									  <dl>
										<dt>电话：</dt>
										<dd>{$vo.mob_phone} &nbsp;{$vo.tel_phone}</dd>
									  </dl>
									  <dl>
										<dt>地址：</dt>
										<dd>{$vo.province}	{$vo.city}	{$vo.area} {$vo.address}</dd>
									  </dl>
									</div>
								  </div>
								</div>
							  </td>
							  <td class="bdl" rowspan="{$vo.i}">
								<p class="ncsc-order-amount">
								
								<if condition="$vo.order_amount gt 0">
								￥{$vo.order_amount}
									<if condition="$vo.points_amount gt 0">
										+
									</if>
								</if>
								<if condition="$vo.points_amount gt 0">
								{$vo.points_amount}&nbsp;积分
								</if>
								<if condition="$vo.gold_amount gt 0">
								{$vo.gold_amount}&nbsp;增值币
								</if>	
								
								</p>
								<p class="goods-freight">
								<if condition="$vo.shipping_fee lt 1">
								（免运费）
								<else/>
								运费:{$vo.shipping_fee}
								</if>
								
								</p>
								<p class="goods-pay" title="支付方式：{$vo.payment_name}">{$vo.payment_name}</p>
							  </td>
							  <td class="bdl bdr" rowspan="{$vo.i}">
								<p>
									<if condition="$vo.order_state eq '0'">
									已取消
									</if>
									<if condition="$vo.order_state eq '10'">
									待付款
									</if>
									<if condition="$vo.order_state eq '20'">
									待发货
									</if>
									<if condition="$vo.order_state eq '30'">
									待收货
									</if>
									<if condition="$vo.order_state eq '40'">
									已收货
									</if>
									                 
								</p>
								<!-- 订单查看 -->
								<p><a href="/store/order_one.html?order_id={$vo.order_id}&order_sn={$vo.order_sn}&rec_id={$gvo.rec_id}" target="_blank">订单详情</a></p>
								
								<!-- 物流跟踪 -->
									<!-- 修改运费 -->
									<!-- 修改价格 -->
								<if condition="$vo.order_state eq '10'">								
									<p><a href="javascript:void(0)" class="ncsc-btn ncsc-btn-green mt10" dialog_url="/store/order_info.html?act=store_order&op=change_state&state_type=spay_price&order_sn={$vo.order_sn}&order_id={$vo.order_id}" dialog_width="480" nc_type="order_dialog" dialog_id="seller_order" dialog_order_sn="{$vo.order_sn}" dialog_user="{$vo.buyer_name}" dialog_price="{$vo.order_amount}"><i class="icon-pencil"></i>修改价格</a></p>
								</if>							
							  </td>
							 </notequal>
							 
							  <!-- 取消订单 -->
							  <td class="bdl bdr" rowspan="1">
							  <if condition="$vo.order_state eq '10'">
									<p><a href="javascript:void(0)" class="ncsc-btn ncsc-btn-red mt5" order_id="{$gvo.order_id}" rec_id="{$gvo.rec_id}"nc_type="dialog_gotout"   dialog_width="400" ><i class="icon-remove-circle"></i>取消订单</a></p>
								</if>
								
								<if condition="$vo.order_state eq '20'">
									<p><a class="ncsc-btn ncsc-btn-green mt10" href="/store/goods_send.html?act=store_deliver&op=send&order_id={$gvo.order_id}"><i class="icon-truck"></i>设置发货</a></p>
								</if>
								</td>
								
							</tr>
							</foreach>
					  </tbody>
					  </foreach>
					  <if condition="$list eq ''">
					  <tbody>
						 <tr>
							<td colspan="20" class="norecord"><div class="warning-option"><i class="icon-warning-sign"></i><span>暂无符合条件的数据记录</span></div></td>
						 </tr>
					  </tbody>
					  </if>
					  <tfoot>
							<tr>
								<td colspan="20">
									<div class="pagination">
										<ul>
											{$page}
										</ul>
									</div>
								</td>
							</tr>
					  </tfoot>
					</table>
					
				</div>
			  </div>
		</div>

  <script type="text/javascript" src="__PUBLIC__/Home/js/template.min.js" charset="utf-8"></script>



<div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" style="display:none">

	<div id="fwin_seller_order_adjust_fee" class="dialog_wrapper ui-draggable" style="">
	
	<div class="dialog_body" style="position: relative;">
		<h3 class="dialog_head" style="cursor: move;"><span class="dialog_title"><span class="dialog_title_icon">修改价格</span></span><span class="dialog_close_button">X</span></h3>
	
		<div class="dialog_content" style="margin: 0px; padding: 0px;">
			<div class="eject_con">
				 <div id="warning"></div>

				  <form id="changeform" method="post" action="">
					<input type="hidden" name="form_submit" value="ok">
					<input type="hidden" name="order_sphash" id="order_sphash" value="">
					
					<dl>
					  <dt>买&nbsp;家：</dt>
					  <dd id="username"></dd>
					</dl>
					<dl>
					  <dt>订单号：</dt>
					  <dd><span class="num" id="order_sn"></span></dd>
					</dl>
					<dl>
					  <dt>修改价格：</dt>
					  <dd>
						<input type="text" class="text" id="goods_amount" name="goods_amount" value="">
					  </dd>
					</dl>
					<dl class="bottom">
					  <dt>&nbsp;</dt>
					  <dd>
						<input type="submit" class="submit" id="confirm_button" value="确定">
					  </dd>
					</dl>
				  </form>
			</div>
		</div>
	</div>
</div>
</div>

<script type="text/javascript">

	$(".dialog_close_button").live('click',function(){
		$("#fwin_seller_order_adjust_fee").hide();
	});
	$('[nc_type="order_dialog"]').live('click',function(){
		
		var style = "z-index: 1100; position: absolute; width: 480px; left: 551.5px; top: 373px;" ;
		var username = $(this).attr('dialog_user');
		var order_sn = $(this).attr('dialog_order_sn');
		var price = $(this).attr('dialog_price');
		var url = $(this).attr('dialog_url');
		//alert(username);
		$("#username").html(username);
		$("#order_sn").html(order_sn);
		$("#goods_amount").val(price);
		$("#order_sphash").val(_getRandomString(27));
		$("#changeform").attr("action",url);
		$("#fwin_seller_order_adjust_fee").attr('style',style);
		$("#fwin_seller_order_adjust_fee").show();
		$("#ui-datepicker-div").show();
		//定位
		scrollOffset($("#fwin_seller_order_adjust_fee").offset());
	});
 

	 //取消订单
	$('[nc_type="dialog_gotout"]').live('click',function(){
		var url = "{:U('member/cancel_order')}" ;
		var order_id = $(this).attr("order_id");
		var rec_id = $(this).attr("rec_id");
		//alert(order_id);
		if(confirm("确定要取消吗？")){
		
			$.ajax({
				url:url,
				data:{act:'member_order',order_id:order_id,rec_id:rec_id,op:'change_state',state_type:'order_cancel'},
				type:'post',
				dataType:'json',
				success:function (data) {
					alert(data);	
					window.location.reload();
							
				}
			});	
			
		}else{
			return false;
		}

	});
 
 
	// jQuery 定位让body的scrollTop等于pos的top，就实现了滚动 
	function scrollOffset(scroll_offset) { 
		$("body,html").animate({ 
		scrollTop: scroll_offset.top - 70 
		}, 0); 
	} 
	
 	// 获取长度为len的随机字符串  
	function _getRandomString(len) {  
			len = len || 32;  
			var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678910'; // 默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1  
			var maxPos = $chars.length;  
			var pwd = '';  
			for (i = 0; i < len; i++) {  
				pwd += $chars.charAt(Math.floor(Math.random() * maxPos));  
			}  
			return pwd;  
	} 
	
</script>
<include file="SpStore:footer" />

</body>

</html>